package com.example.rpcdemo.client.controller;

import com.example.rpcdemo.api.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/hello")
public class HelloController {
    
    @Autowired
    private HelloService helloService;
    
    @GetMapping("/{name}")
    public String sayHello(@PathVariable String name) {
        return helloService.sayHello(name);
    }
}